home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 151-175 / scopedisk168 / asmmacros / am_02 / write.i < prev    next >
Text File  |  1995-03-19  |  2KB  |  75 lines

  1.      NOLIST
  2. Write       MACRO              ; 21 Dec 88
  3. *------------------------------; Start of Write macro.
  4.                                ; Put the file handle in D1.
  5.      NOLIST
  6.      IFEQ ReEntrant-1
  7.      LIST
  8.      MOVE.L \3(A5),D1
  9.      NOLIST
  10.      ENDC
  11.      IFNE ReEntrant-1
  12.      LIST
  13.      MOVE.L \3,D1
  14.      NOLIST
  15.      ENDC
  16.      LIST
  17.                                ; Make D2 point to the start of the buffer.
  18.      NOLIST
  19.      IFC '\1','D'
  20.      LIST
  21.      MOVE.L #\2,D2
  22.      NOLIST
  23.      ENDC
  24.      IFC '\1','I'
  25.      IFEQ ReEntrant-1
  26.      LIST
  27.      MOVE.L \2.Adr(A5),D2
  28.      NOLIST
  29.      ENDC
  30.      IFNE ReEntrant-1
  31.      LIST
  32.      MOVE.L \2.Adr,D2
  33.      NOLIST
  34.      ENDC
  35.      ENDC
  36.      IFEQ NARG-3               ; If there is no fourth argument, and
  37.      IFC '\1','D'              ;  <BufferStartAddr> is specified, then
  38.      LIST
  39.                                ; Calculate the buffer size as
  40.                                ;  <BufferStartAddr>End minus
  41.                                ;  <BufferStartAddr>. Put it in D3.
  42.      MOVE.L #\2End-\2,D3
  43.      NOLIST
  44.      ENDC
  45.      IFC '\1','I'              ; If <MemBlockName> is specified, then
  46.      LIST
  47.                                ; Get the buffer size from <MemBlockName>.Size
  48.      NOLIST
  49.      IFEQ ReEntrant-1
  50.      LIST
  51.      MOVE.L \2.Size(A5),D3
  52.      NOLIST
  53.      ENDC
  54.      IFNE ReEntrant-1
  55.      LIST
  56.      MOVE.L \2.Size,D3
  57.      NOLIST
  58.      ENDC
  59.      ENDC
  60.      ENDC
  61.      IFEQ NARG-4               ; If the fourth argument exists,
  62.      IFNC '\4','D3'            ;  and it is not "D3", then
  63.      LIST
  64.                                ; Use the buffer size of the fourth argument.
  65.      MOVE.L #\4,D3
  66.      NOLIST
  67.      ENDC
  68.      ENDC
  69.      LIST
  70.      CallLib Write,dos         ; Call Write.
  71.      CMPI.L #-1,D0             ; Make the zero flag indicate failure.
  72. *------------------------------; End of Write macro.
  73.      ENDM
  74.      LIST
  75.